
package com.shangsi.controller;

import com.alibaba.nacos.common.utils.UuidUtils;
import com.shangsi.model.TOrder;
import com.shangsi.service.OrderService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author dzd
 * @date 2021-12-19
 */
@RestController
public class OrderController {

    @Resource
    OrderService orderService;

    @PostMapping("createOrder")
    public Boolean createOrder(@RequestBody TOrder order){
        System.out.println("order---------------");
        order.setOrderNo(UuidUtils.generateUuid());
        orderService.createOrder(order);
        return true;
    }
}
